/* Enkel side – men grafisk spillflate */
:root{
  --bg: #0d1117;
  --card: #0b3d2e;
  --accent: #2bd970;
  --accent-2:#22c55e;
  --ink: #e6ffee;
  --muted:#9be4bc;
  --danger:#ff5964;
  --drop:#0e5a43;
  --shadow: 0 10px 30px rgba(0,0,0,.4);
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  background: linear-gradient(135deg, #052b20 0%, #0d1117 60%, #0b1b16 100%);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
  color: var(--ink);
  position: relative;
  overflow-x: hidden;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Animerte partikler i bakgrunnen */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 20% 80%, rgba(43, 217, 112, 0.1) 0%, transparent 50%),
              radial-gradient(circle at 80% 20%, rgba(34, 197, 94, 0.1) 0%, transparent 50%),
              radial-gradient(circle at 40% 40%, rgba(16, 163, 74, 0.05) 0%, transparent 50%);
  animation: particleFloat 20s ease-in-out infinite;
  pointer-events: none;
  z-index: -1;
}

@keyframes particleFloat {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  33% { transform: translateY(-20px) rotate(120deg); }
  66% { transform: translateY(10px) rotate(240deg); }
}
.wrap{max-width:1100px;margin:0 auto;padding:16px}
.topbar{
  display:flex;align-items:center;justify-content:space-between;gap:12px;
}
h1{margin:0;font-size:clamp(1.2rem,2.5vw,1.8rem);letter-spacing:.5px}
.hud{display:flex;gap:12px}
.stat{
  display:flex;align-items:center;gap:8px;
  background: rgba(12, 46, 35, 0.6);
  backdrop-filter: blur(10px);
  padding:8px 12px;
  border:1px solid rgba(18, 78, 59, 0.3);
  border-radius:999px;
  color:var(--muted);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2),
              0 0 0 1px rgba(255, 255, 255, 0.05),
              inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.stat:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3),
              0 0 0 1px rgba(43, 217, 112, 0.2),
              0 0 15px rgba(43, 217, 112, 0.1);
}
.stat strong{color:var(--ink);min-width:3ch;text-align:right}

.timer-stat{
  position:relative;
  padding:8px;
}
.timer-circle{
  position:relative;
  width:60px;
  height:60px;
  display:flex;
  align-items:center;
  justify-content:center;
}
.timer-svg{
  position:absolute;
  width:100%;
  height:100%;
  transform:rotate(-90deg);
}
.timer-bg{
  fill:none;
  stroke:#124e3b;
  stroke-width:8;
}
.timer-progress{
  fill:none;
  stroke:var(--accent);
  stroke-width:8;
  stroke-linecap:round;
  stroke-dasharray:283;
  stroke-dashoffset:283;
  transition:stroke-dashoffset 1s linear;
}
.timer-text{
  position:relative;
  z-index:1;
  font-size:.9rem;
  font-weight:700;
  color:var(--ink);
}

.progress-container{
  margin-top:12px;
  display:flex;align-items:center;gap:12px;
}
.progress-bar{
  flex:1;
  height:8px;
  background:#0c2e23;
  border-radius:999px;
  overflow:hidden;
  border:1px solid #124e3b;
}
.progress-fill{
  height:100%;
  background:linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius:999px;
  width:0%;
  transition:width .5s ease;
  box-shadow:0 0 10px rgba(43, 217, 112, .3);
}
.progress-text{
  font-size:.9rem;
  color:var(--muted);
  min-width:120px;
  text-align:right;
}

.arena{
  margin-top:16px;
  display:grid;
  grid-template-columns:1fr;
  gap:16px;
}
.wordcard{
  position:relative;
  background: rgba(11, 61, 46, 0.3);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(43, 217, 112, 0.2);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3), 
              0 0 0 1px rgba(255, 255, 255, 0.1),
              inset 0 1px 0 rgba(255, 255, 255, 0.2);
  border-radius:24px;
  padding:24px;
  min-height:180px;
  display:flex;align-items:center;justify-content:center;
  overflow:hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.wordcard::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 50% 0%, rgba(43, 217, 112, 0.1) 0%, transparent 70%);
  border-radius: 24px;
  pointer-events: none;
}
.wordcard .badge{
  position:absolute;top:10px;left:10px;
  font-size:.85rem;color:var(--muted);background:#0c2e23;border:1px solid #124e3b;border-radius:999px;padding:6px 10px
}
.word-display{
  font-size:clamp(1.8rem,6vw,3rem);
  font-weight:800;
  text-transform:none;
  letter-spacing:.5px;
  padding:16px 22px;
  background:linear-gradient(180deg, #2bd970, #16a34a);
  color:#04170f;
  border-radius:18px;
  border:2px solid #073b2b;
  box-shadow: 0 14px 30px rgba(27, 217, 112, .35), inset 0 1px 0 rgba(255,255,255,.2);
  user-select:none;
  transform: perspective(600px) translateZ(0);
  transition: all .3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: wordAppear 0.5s ease-out;
}

@keyframes wordAppear {
  0% {
    opacity: 0;
    transform: scale(0.8) translateY(20px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.word-display.new-word {
  animation: wordChange 0.4s ease-in-out;
}

@keyframes wordChange {
  0% {
    transform: scale(1) rotateY(0deg);
  }
  50% {
    transform: scale(0.9) rotateY(90deg);
    opacity: 0.7;
  }
  100% {
    transform: scale(1) rotateY(0deg);
    opacity: 1;
  }
}

.targets{
  display:grid;
  grid-template-columns:repeat(2, 1fr);
  gap:16px;
}
.clickzone{
  background: rgba(8, 52, 40, 0.4);
  backdrop-filter: blur(15px);
  border: 1px solid rgba(19, 109, 82, 0.3);
  border-radius:18px;
  min-height:120px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2),
              0 0 0 1px rgba(255, 255, 255, 0.05),
              inset 0 1px 0 rgba(255, 255, 255, 0.1);
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  padding:14px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  outline:none;
  cursor:pointer;
  position: relative;
  overflow: hidden;
}

.clickzone::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.5s ease;
}

.clickzone:hover::before {
  left: 100%;
}
.clickzone .label{font-weight:800;margin-bottom:6px}
.clickzone .hint{font-size:.9rem;color:var(--muted)}
.clickzone:hover, .clickzone.hover{
  transform:translateY(-4px) scale(1.02);
  border-color:var(--accent);
  background: rgba(10, 63, 47, 0.6);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3),
              0 0 0 1px rgba(43, 217, 112, 0.3),
              0 0 20px rgba(43, 217, 112, 0.2),
              inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.clickzone:active{
  transform:translateY(-2px) scale(0.98);
  transition: all 0.1s ease;
}
.clickzone.accept{border-color:var(--accent-2);animation:pulse .8s ease}
.clickzone.reject{border-color:var(--danger);animation:shake .3s linear}

.footer{
  display:flex;align-items:center;gap:12px;margin-top:8px
}
.btn{
  background:var(--accent);
  border:none;border-radius:12px;padding:10px 16px;
  font-weight:700;color:#083827;cursor:pointer;
  box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .2s ease;
}
.btn:hover{
  transform:translateY(-2px);
  box-shadow: 0 15px 35px rgba(43, 217, 112, .4);
}
.btn:active{
  transform:translateY(0px) scale(.98);
}
.btn:disabled{opacity:.6;cursor:not-allowed;transform:none}
.btn.hidden{display:none}
.btn-large{
  padding:16px 24px;
  font-size:1.1rem;
  border-radius:16px;
}
.msg{min-height:1.6em;color:var(--muted)}

.hidden{display:none!important}

.modal{
  position:fixed;inset:0;background:rgba(0,0,0,.6);
  display:flex;align-items:center;justify-content:center;
}
.modal-card{
  background:#092a20;border:1px solid #155d48;color:var(--ink);
  border-radius:16px;padding:22px;max-width:420px;width:92%;
  box-shadow:var(--shadow);
}
.modal-card h2{margin-top:0}

@keyframes shake{0%{transform:translateX(0)}25%{transform:translateX(-6px)}50%{transform:translateX(6px)}75%{transform:translateX(-3px)}100%{transform:translateX(0)}}
@keyframes pulse{0%{box-shadow:0 0 0 0 rgba(43,217,112,.4)}100%{box-shadow:0 0 0 12px rgba(43,217,112,0)}}

/* Poeng-animasjoner */
.score-animation {
  position: absolute;
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--accent);
  pointer-events: none;
  z-index: 1000;
  animation: scoreFloat 1s ease-out forwards;
}

@keyframes scoreFloat {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-50px) scale(1.2);
  }
}

/* Konfetti-animasjon */
.confetti {
  position: fixed;
  width: 10px;
  height: 10px;
  background: var(--accent);
  animation: confettiFall 3s linear forwards;
  z-index: 1000;
}

@keyframes confettiFall {
  0% {
    transform: translateY(-100vh) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

/* Loading-animasjon */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(43, 217, 112, 0.3);
  border-radius: 50%;
  border-top-color: var(--accent);
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width:720px){
  .targets{grid-template-columns:1fr}
  .wordcard{min-height:140px}
}
